<div class="judul"><?php echo anchor("/pekerjaan/", $title);?></div>
<script type="text/javascript">
    $(document).ready(function(){
        $("input[type=submit]").click(function(){
            if($('#nama').val() == ""){
                alert('Nama pekerjaan tidak boleh kosong');
                $('#nama').focus();
                return false;
            }
        })        
    })
</script>
<?php
  $flashdata = $this->session->flashdata('message');
  $messages = isset ($flashdata)?pesan($flashdata):"";
  echo "$messages";
  $form = isset ($formView)?$formView:"";
  if($form != ""){
     $this->load->view("$form"); 
  }
?>  
<div class="data-list">
    <div class="floleft" style="margin: 8px 0">
        <?php
          echo addButton('pekerjaan/add_pekerjaan_form', 'tambah');
        ?>
    </div>    
    <table class="tabel" style="width: 50%">
        <tr>
            <th>No</th>
            <th>Nama</th>
            <th>Aksi</th>
        </tr>
        <?php
            $no = 1;
            foreach ($listPekerjaan as $row){
        ?>
            <tr class="<?php echo ($no%2)?"even":"odd";?>">
                <td align="center" style="width: 10%"><?php echo $no++;?></td>
                <td><?php echo $row['nama'];?></td>
                <td class="aksi" style="width: 30%">
                    <?php
                       echo anchor('pekerjaan/edit_pekerjaan_form/'.$row['id'], 'edit', 'class=edit title="edit"');
                       echo anchor('pekerjaan/delete_pekerjaan/'.$row['id'],'hapus','class=delete title="edit" onClick="return confirm(\'Apakah anda benar-benar akah menghapus data ini\')"');
                    ?>
                </td>
            </tr>
        <?php
            }
        ?>
    </table>
</div>
